package com.mq.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * 将RestTemplate对象注册到容器中
 */
@Configuration
public class ApplicationContextConfig {
    //@Bean 相当于xml里面的<bean id=""  class="">
    @Bean
    @LoadBalanced //负载均衡注解
    public RestTemplate getRestTemplate(){
       return new RestTemplate();
    }
}
